import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { MAINROUTEDATA } from './route';

import { setMAINROUTE, globalStore } from '@ds/ds-micro/dist';
import { defineCustomElements } from '@ds/ds-micro/dist/loader';
import { initStart } from '@ds/ds-micro-lib/dist';

initStart();
setMAINROUTE(MAINROUTEDATA);


// 测试全局store的地方
let i = 0;
setInterval(() => {
  globalStore().next({data: i++})
}, 5000)


if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch((err) => console.error(err));

defineCustomElements();
